package com.winway.sixbook.custom;

import com.winway.sixbook.AppContext;
import com.winway.sixbook.R;
import com.winway.sixbook.StartActivity;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;

public class AlarmAlert extends Activity{
	
  @Override
  protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    new AlertDialog.Builder(AlarmAlert.this)
        .setIcon(R.drawable.ic_launcher)
        .setTitle("功过格提醒")
        .setMessage("    尊敬的用户，您制定的添加功过格提醒时间到，请及时按照计划完成！")
        .setPositiveButton("关闭",new DialogInterface.OnClickListener(){
        	@Override
			public void onClick(DialogInterface dialog, int whichButton){
        		AlarmAlert.this.finish();
        		AppContext appState = ((AppContext)getApplicationContext());
        		if(null != appState && appState.getSysstate().equals("nook")){
        			Intent newinIntent = new Intent(AlarmAlert.this,StartActivity.class);
            		startActivity(newinIntent);
            		finish();
        		}
        	}
        }).show();
  } 
}
